import { request } from '@/utils/request.js'

export default {
 
//服务
  service() {
    return request({
      url: 'logistics/service/list',
      method: 'get',
    })
  },
//部门
  dept() {
    return request({
      url: 'system/dept/list',
      method: 'get',
      params: {select: 'id,name'},
    })
  },
//员工
user() {
    return request({
      url: 'system/user/list',
      method: 'get',
      params: {select: 'id,username,nickname'},
    })
  },
  //货站
  depot(params = {}) {
    return request({
      url: 'warehouse/depot/list',
      method: 'get',
      params
    })
  },
  //用户等级
  customerGrade() {
    return request({
      url: 'customers/customerGrade/list',
      method: 'get',
    })
  },
  //供应商服务
  supplier_service() {
    return request({
      url: 'logistics/supplierService/list',
      method: 'get',
    })
  },



  // 提单列表
  waybill() {
    return request({
      url: 'document/waybill/list',
      method: 'get',
    })
  },
  waybillShouldSelect() {
    return request({
      url: 'document/waybill/list',
      method: 'get',
    })
  },
  //用户
  customer() {
    return request({
      url: 'customers/customer/list',
      method: 'get',
      params: {select: 'id,username,nick'},
    })
  },
  //  addressLibDetail() {
  //   return request({
  //     url: 'customers/customer/list',
  //     method: 'get',
  //   })
  // },
   supplier_service_with_type(value) {
    return request({
      url: 'logistics/supplierService/list?type=' + value,
      method: 'get',
    })
  },
  // 船期
  shipping_schedule() {
    return request({
      url: 'logistics/shippingScheduleGroup/tree',
      method: 'get',
    })
  },
  // shipping_schedule() {
  //   return request({
  //     url: 'document/shippingSchedule/list',
  //     method: 'get',
  //   })
  // },
  shipping_schedule_with_type(type) {
    return request({
      url: 'document/shippingSchedule/list?type=' + type,
      method: 'get',
    })
  },
  // 港口/车站
  place() {
    return request({
      url: 'logistics/place/list',
      method: 'get',
    })
  },
  place_with_type(value) {
    return request({
      url: 'logistics/place/list?type=' + value,
      method: 'get',
    })
  },
  // 供应商
  supplier(params = {}) {
    return request({
      url: 'logistics/supplier/list',
      method: 'get',
      params
    })
  },
  // 清关代理
  supplier_clearance() {
    return request({
      url: 'logistics/supplier/list?type[]=8',
      method: 'get',
    })
  },
   // 报关代理
   supplier_declare() {
    return request({
      url: 'logistics/supplier/list?type[]=7',
      method: 'get',
    })
  },
  firstLegTransportation() {
    return request({
      url: 'document/firstLegTransportation/list',
      method: 'get',
    })
  },
  delivery() {
    return request({
      url: 'warehouse/delivery/list',
      method: 'get',
    })
  },
  firstLegTransportationWithType(type) {
    return request({
      url: 'document/firstLegTransportation/list?type=' + type,
      method: 'get',
    })
  },
  //标识
  tags() {
    return request({
      url: 'logistics/tag/list',
      method: 'get',
    })
  },
   //标识
   tagsType(type) {
    return request({
      url: 'logistics/tag/list',
      method: 'get',
      params: {select: 'id,name,color',type:type},
    })
  },
  //地址编码
  addressLibDetail(type) {
    return request({
      url: 'logistics/addressLibDetail/userlist',
      method: 'get',
      params: {select: 'code,postcode,name,id',type:type},

    })
  },
  //全部地址编码
  addressLibDetailAll(type) {
    return request({
      url: 'logistics/addressLibDetail/userlist',
      method: 'get',
      params: {type:type},

    })
  },
   //服务
   serviceGroup() {
    return request({
      url: 'logistics/serviceGroup/tree',
      method: 'get',
    })
  },
   //费用类型
   feeTypeRemote() {
    return request({
      url: 'finance/feeType/remote',
      method: 'post',
    })
  },
    //费用类型
    feeTypeList(params={}) {
      return request({
        url: 'finance/feeType/list',
        method: 'get',
        params
      })
    },
    //最后路由
	routeTypeList(params={}) {
	  return request({
	    url: 'routes/routeType/list',
	    method: 'get',
      params: {select: 'id,name'},
      })
    },
    //服务项目
    waybillServiceTypeList(params={}) {
      return request({
        url: 'sea/waybillServiceType/list',
        method: 'get',
        params
      })
    },
    //服务类型
    waybillServiceShipmentTypeList(params={}) {
      return request({
        url: 'sea/waybillServiceShipmentType/list',
        method: 'get',
        params
      })
    },
    //目的地
    addressChang(id) {
      return request({
        url: '/sea/waybill/address/'+ id,
        method: 'get',
      })
    },
    //目的地
    allAddress() {
      return request({
        url: '/sea/waybill/all_address',
        method: 'get',
      })
    },
    //车辆列表
    waybillCarList(params={}) {
      return request({
        url: 'sea/waybillCar/list',
        method: 'get',
        params
      })
    },
    //出货单列表
    waybillTaskSendList(params={}) {
      return request({
        url: 'sea/waybillTaskSend/list',
        method: 'get',
        params
      })
    },
     //任务服务类型
     waybillServiceTaskType(params={}) {
      return request({
        url: 'sea/waybillServiceTaskType/list',
        method: 'get',
        params
      })
    },
}
